<?php


require_once("classes/newsletter.class.php");
$id = $_GET['newsletter'];


$newsletter = new Newsletter();

$info = $newsletter->searchObjectInfo($id);
$content = $newsletter->searchObjectContbyFK($id);
$footer = $newsletter->searchObjectFoobyFK($id);

$listInfo = mysql_fetch_assoc($info);
//$listContent = mysql_fetch_assoc($content);


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Newsletter - <?php echo $listInfo['numero'];?> </title>





</head>

<body style="font-family:Verdana, Geneva, sans-serif;
font-size:11px;	
margin: 0px;">
<table width="580" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
    <td width="100%"><img src="http://www.qualisample.com/controller/newsletter/images/logoen.jpg" width="579" height="62" /></td>
  </tr>
  <tr>
    <td style="padding:15px;">

	
	<?php 
	
	$ano = $listInfo['ano'];
	$numero = $listInfo['numero'];;
	$mes = $listInfo['mes'];
	
	
	
	
	?>
    
    <span style='padding-right:100px;text-align:left;height:30px;color:#900;font-weight:bold;'>
		Ano: <?php echo $ano; ?>
		</span>
    	<span style='padding-right:100px;text-align:left;height:30px;color:#900;font-weight:bold;'>
		No.: <?php echo $numero; ?>
		</span>
    	<span style='padding-right:100px;text-align:left;height:30px;color:#900;font-weight:bold;'>
		M&ecirc;s: <?php echo $mes ; ?>
		</span>
    
    </td>
  </tr>
  <tr>
    <td align="center" ><table width="100%" border="0" cellspacing="5" cellpadding="5">
      <tr>
        <td colspan="2" bgcolor="#F4F4F4"><p style="text-align:justify;style="padding:15px;"><?php 
	$titulo= NULL;
	$titulo2=NULL;
	$titulo3=NULL;
	$noticia=NULL;
	$noticia2=NULL;
	$noticia3=NULL;
while($textInfo =mysql_fetch_assoc($content) ){
	
	if($textInfo['ordem']==1){
		
	
	$titulo = $textInfo['titulo'];
	$noticia = html_entity_decode($textInfo['resumo']);
	$textolink = $textInfo['texto'];
	$link = $textInfo['link'];
	}elseif($textInfo['ordem']==2){
		
	
	$titulo2 = $textInfo['titulo'];
	$noticia2 = html_entity_decode($textInfo['resumo']);
	$textolink2 = $textInfo['texto'];
	$link2 = $textInfo['link'];
	}elseif($textInfo['ordem']==3){
		
	
	$titulo3 = $textInfo['titulo'];
	$noticia3 = html_entity_decode($textInfo['resumo']);
	$textolink3 = $textInfo['texto'];
	$link3 = $textInfo['link'];
	}
	
	}
echo($titulo);
	?>    
      <?php
    echo($noticia);
	?>
    <br />
     </p><br />
   <a href="<?php
    echo($link);
	?>"><?php
    echo($textolink);
	?></a></td>
  </tr>
  <tr >
    <td width="50%" bgcolor="#DDDDDD" style="padding:15px;>
   <p style="text-align:justify;">
  <h1 style="font-family:Verdana, Geneva, sans-serif;font-size: 14px;
    font-weight:bold;color:#900"> <?php 

echo($titulo2);
	?></h1><?php
    echo($noticia2);
	?>
    <br />
     </p><br />
   <a href="<?php
    echo($link2);
	?>"><?php
    echo($textolink2);
	?>.</a></td>
    <td width="50%" bgcolor="#DDDDDD" style="padding:15px; >
  <p style="text-align:justify;">
  <h1 style="font-family:Verdana, Geneva, sans-serif;font-size: 14px;
    font-weight:bold;color:#900"> <?php 

echo($titulo3);
	?></h1><?php
    echo($noticia3);
	?>
    <br />
     </p><br />
   <a href="<?php
    echo($link3);
	?>"><?php
    echo($textolink3);
	?></a></td>
      </tr>
      
    </table></td>
  </tr>
  <tr>
    <td align="center" >
    <?php 
	$foot = mysql_fetch_assoc($footer);
	
	echo html_entity_decode($foot['footer']);
	?>
    
    
    </td>
  </tr>
  <tr>
    <td align="center" >&nbsp;</td>
  </tr>
  <tr>
    <td align="center" >&nbsp;</td>
  </tr>
  <tr>
    <td align="center" ><img src="images/footermessage.png" width="600" height="309" /></td>
  </tr>
  
  <tr>
    <td bgcolor="#686868" style="padding:15px; ><a target="_blank" href="http://www.facebook.com/people/QualiSample-Painel-Intercultural/100000013883173">
<img src="http://www.qualisample.com/controller/newsletter/images/FaceBook_32x32.png" alt="Become Friend" width="32" height="32" border="0"/></a>
<a target="_blank" href="http://twitter.com/QualiSample"><img src="http://www.qualisample.com/controller/newsletter/images/Twitter_32x32.png" alt="Follow Us" width="32" height="32" border="0"/></a></td>
  </tr>
</table>


</body>
</html>